package com.fan.chat.component.context;

import com.plexpt.chatgpt.entity.chat.Message;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class ChatContextHolder {

    private ChatContextStrategy chatContextStrategy;

    public ChatContextHolder(ChatContextStrategy chatContextStrategy) {
        this.chatContextStrategy = chatContextStrategy;
    }

    public List<Message> getListMessage(String id) {
        return chatContextStrategy.getListMessage(id);
    }

    public void addMessage(String id, Message message) {
        chatContextStrategy.addMessage(id, message);
    }

    public void addMessage(String id, List<Message> messages) {
        chatContextStrategy.addMessage(id, messages);
    }

}
